package cn.itsource.pet.controller;

import cn.itsource.basic.util.JsonResult;
import cn.itsource.pet.domain.OrderPetAcquisition;
import cn.itsource.pet.domain.SearchMasterMsg;
import cn.itsource.pet.query.OrderPetAcquisitionQuery;
import cn.itsource.pet.query.SearchMasterMsgQuery;
import cn.itsource.pet.service.IOrderPetAcquisitionService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 宠物订单类
 */
@RestController
@Api(tags = "宠物接单类", description = "宠物接单类")
@RequestMapping("/order")
public class OrderPetAcquisitionController {
    @Resource
    private IOrderPetAcquisitionService orderPetAcquisitionService;
    @PostMapping("/jieDan")
    public JsonResult jieDan(@RequestBody SearchMasterMsg msg ){
        return orderPetAcquisitionService.jieDan(msg);
    }
    @PostMapping("/findPage")
    public JsonResult findPage(@RequestBody OrderPetAcquisitionQuery orderPetAcquisitionQuery){
        return JsonResult.createSuccess(orderPetAcquisitionService.findPage(orderPetAcquisitionQuery));
    }
    @PostMapping("/adopt")
    public JsonResult adoptshenhe(@RequestBody OrderPetAcquisition orderPetAcquisition){
        return orderPetAcquisitionService.adoptshenhe(orderPetAcquisition);
    }
    @PostMapping("/cancel")
    public JsonResult adoptCancel(@RequestBody OrderPetAcquisition orderPetAcquisition){
        return orderPetAcquisitionService.adoptCancel(orderPetAcquisition);
    }
}
